package tech.wangpai.microservice.product.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.wangpai.microservice.product.domain.Product;
import tech.wangpai.microservice.product.repository.ProductMapper;
import tech.wangpai.microservice.product.service.ProductService;

import java.util.List;
@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductMapper productMapper;

    @Override
    public List<Product> queryUserByUsername(String pname) {
        return productMapper.queryUserByUsername(pname);
    }

    @Override
    public Product getProductById(String productId) {
        return productMapper.getProductById(productId);
    }

    @Override
    public void addProduct(Product product) {
        productMapper.addProduct(product);
    }

    @Override
    public void delProductById(String productId) {
        productMapper.delProductById(productId);
    }

    @Override
    public void updateProductById(Product product) {
        productMapper.updateProductById(product);
    }
}
